New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@trapi/decorator

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trapi/decorator

[![main](https://github.com/Tada5hi/trapi/actions/workflows/main.yml/badge.svg)](https://github.com/Tada5hi/trapi/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/Tada5hi/trapi/branch/main/graph/badge.svg?token=ZUJ8F5TTSX)](https://codecov.io

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

@trapi/decorator 📚

main codecov Known Vulnerabilities npm version

Inspect the CHANGELOG.md in the repository for breaking changes.

Table of Contents

Installation

npm install --save @trapi/decorator

Configuration

declare type Config = {
    /**
     * Use a pre-defined third party configuration in full scope or
     * only use a partial amount of defined type representations.
     *
     * Default: []
     */
    library?: LibraryConfig;
    /**
     * Use all internal defined representations or only use a subset.
     *
     * Default: true
     */
    internal?: MapperIDs;
    /**
     * Set up self defined aka. custom representations.
     */
    custom?: Partial<MapperIDRepresentation>;
}

Usage

import { Config, Mapper, NodeDecorator } from '@trapi/decorator';

const mapper = new Mapper({
    internal: true
});

const decorators : NodeDecorator[] = [
    { text: 'SwaggerTags', arguments: [['auth', 'admin']], typeArguments: [] },
    { text: 'SwaggerTags', arguments: [['auth'], ['admin']], typeArguments: [] },
    { text: 'SwaggerTags', arguments: [], typeArguments: [] },
];

let match = mapper.match('SWAGGER_TAGS', decorators);
let value = match.getPropertyValue('DEFAULT');
console.log(value);
// ['auth', 'admin']

match = mapper.match('RESPONSE_EXAMPLE', decorators);
console.log(match);
// undefined

License

Made with 💚

Published under MIT License.

Keywords

FAQs

Package last updated on 04 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc